
<%@ page import = "clothing.database.Supplier" %>
<%@ page import = "java.util.ArrayList" %>
<%@page import = "clothing.database.SupplierManager" %>
<%@ include file = "templates/header.jsp" %>

<%
String id =request.getParameter("id2");
int iid = Integer.parseInt(id);



SupplierManager sm = new SupplierManager();
Supplier editSupplier = sm.getSupplier(iid);
String Name = editSupplier.getName();


int ContactNumber = editSupplier.getContactNumber();
String Street = editSupplier.getStreet();
String City = editSupplier.getCity();
String State = editSupplier.getState();
int Zip = editSupplier.getZip();

%>


<h3> Edit Supplier Page </h3>

<script>
function process(a)
{
		document.getElementById('id').value=a;
		document.myform.submit();
}  
</script>
   
	
<h2></h2>
<form name="myform" id="myform" action ="updateSupplier.jsp" method = "post" >
	<table>
		<tr>
            <td>Supplier ID</td>
            <% out.println("<td name=\"id\" value=\""+id+"\"></td>"); %>
            
            
        </tr>
        <tr>
			<td>Name: </td>           
            <% out.println("<td><input name=\"Name\" value=\""+Name+"\"></td>"); %>
                 
		</tr>
        <tr>
			<td>Contact: </td>           
            <% out.println("<td><input name=\"ContactNumber\" value=\""+ContactNumber+"\"></td>"); %>
                 
		</tr>
        <tr>
			<td>Street: </td>           
            <% out.println("<td><input name=\"Street\" value=\""+Street+"\"></td>"); %>
                 
		</tr>
        <tr>
			<td>City: </td>           
            <% out.println("<td><input name=\"City\" value=\""+City+"\"></td>"); %>
                 
		</tr>
        <tr>
			<td>State: </td>           
            <% out.println("<td><input name=\"State\" value=\""+State+"\"></td>"); %>
                 
		</tr>
        <tr>
			<td>Zip: </td>           
            <% out.println("<td><input name=\"Zip\" value=\""+Zip+"\"></td>"); %>
                 
		</tr>
        
    <tr>
			<td> </td><td><input type="submit" value= "submit" onclick = "process(<%= id %>);" /></td>
		</tr>
    <input type="hidden" name ="id" id = "id" />
	</table>
	</form>

<%@ include file = "templates/footer.jsp" %>


